﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="EditComments.aspx.vb" Inherits="Assignment4.EditComments" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<h1>Edit and Approve Comments</h1>
    <asp:GridView ID="grvComments" runat="server" AutoGenerateColumns="False" 
        BackColor="White" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" 
        CellPadding="4" DataSourceID="SqlDataSourceSelectNotVisibleComments" 
        Width="861px">
        <Columns>
            <asp:BoundField DataField="CommentContent" HeaderText="Comment" 
                SortExpression="CommentContent" />
            <asp:BoundField DataField="ProfileName" HeaderText="Name" 
                SortExpression="ProfileName" />
            <asp:BoundField DataField="ProfileSurname" HeaderText="Surname" 
                SortExpression="ProfileSurname" />
            <asp:ImageField DataImageUrlField="ProfileAvatar" 
                DataImageUrlFormatString="../{0}" HeaderText="Avatar">
                <ControlStyle CssClass="gridpicture" />
            </asp:ImageField>
            <asp:HyperLinkField DataNavigateUrlFields="CommentId" 
                DataNavigateUrlFormatString="EditComments.aspx?EditCommentId={0}" Text="Edit" />
            <asp:HyperLinkField DataNavigateUrlFields="CommentId" 
                DataNavigateUrlFormatString="EditComments.aspx?ApproveCommentId={0}" 
                Text="Approve" />
            <asp:HyperLinkField DataNavigateUrlFields="CommentId" 
                DataNavigateUrlFormatString="EditComments.aspx?DeleteCommentId={0}" 
                Text="Delete" />
        </Columns>
        <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
        <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
        <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
        <RowStyle BackColor="White" ForeColor="#003399" />
        <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
        <SortedAscendingCellStyle BackColor="#EDF6F6" />
        <SortedAscendingHeaderStyle BackColor="#0D4AC4" />
        <SortedDescendingCellStyle BackColor="#D6DFDF" />
        <SortedDescendingHeaderStyle BackColor="#002876" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSourceSelectNotVisibleComments" runat="server" 
        ConnectionString="<%$ ConnectionStrings:learningConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:learningConnectionString.ProviderName %>" 
        SelectCommand="SELECT * FROM [QuerySelectCommentsNotVisibleByQuizIdDesc]">
    </asp:SqlDataSource>
    <br />
    <table class="style1">
        <tr>
            <td>
                <asp:TextBox ID="txtComment" runat="server" Height="42px" TextMode="MultiLine" 
                    Width="687px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                  CssClass="lblmessage"  ErrorMessage="Enter Comment" ValidationGroup="update" 
                    ControlToValidate="txtComment"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Button ID="btnUpdate" runat="server" Text="Update" 
                    ValidationGroup="update" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>
            </td>
        </tr>
    </table>
&nbsp;
</asp:Content>
